package com.wangfugui.mybatisplus.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wangfugui.mybatisplus.dao.SecurityInfoDao;
import com.wangfugui.mybatisplus.domain.SecurityInfo;
import com.wangfugui.mybatisplus.service.SecurityInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.stream.Collectors;


@Service
@Slf4j
public class SecurityInfoServiceImpl extends ServiceImpl<SecurityInfoDao, SecurityInfo> implements SecurityInfoService {


    @Override
    public Map<String, SecurityInfo> getSecurityInfoMap() {
        Map<String, SecurityInfo> map = list().stream().collect(Collectors.toMap(e -> e.getCode(), e -> e, (e1, e2) -> e1));
        return  map;
    }
}
